package com.cskaoyan.model.vo;

import com.cskaoyan.model.Issue;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @ClassName: IssueDataVO
 * @Description: TODO   通用问题DataVO
 * @Author:
 * @Date: 2022/5/5 20:58
 * @Version: 1.0
 **/
@NoArgsConstructor
@Data
public class IssueDataVO {
    private Integer total; //总的数据量，没有分页的情况下的数据量
    private Integer pages; //总的页码数
    private Integer limit; //当前页最多的数据量
    private Integer page; //当前页的页码
    private List<Issue> list;//当前页显示的问题列表数据

    public static IssueDataVO data(long total, Integer pages, Integer limit, Integer page, List list){
        IssueDataVO issueDataVO = new IssueDataVO();
        issueDataVO.setTotal((int)total);
        issueDataVO.setPages(pages);
        issueDataVO.setPage(page);
        issueDataVO.setLimit(limit);
        issueDataVO.setList(list);
        return issueDataVO;
    }

}
